
# import os
#
# os.path.ex

import psutil

# 获取磁盘分区信息
partitions = psutil.disk_partitions()
print(partitions)
# 提取磁盘符号
disk_symbols = [partition.mountpoint.split(':')[0] for partition in partitions]

# 输出磁盘符号
print("当前电脑上的所有磁盘符号：", disk_symbols)